<template>
  <div id="son">
    二级组件 -- 子级别 --- 信息：{{ name }} -- {{ age }} -- {{ gender }}
    <grand-son />
  </div>
</template>

<script>
import { setup, inject, toRefs } from "vue";

import GrandSon from "./GrandSon.vue";

export default {
  components: { GrandSon },
  setup() {
    const info = inject("info");

    return {
      info,
      ...toRefs(info),
    };
  },
};
</script>

<style scoped>
#son {
  background: skyblue;
  padding: 20px;
}
</style>
